#pragma once
// 这个文件就是用来统一设置退出码的

#include <iostream>
#include <functional>
#include <string>
#include <cstring>
#include <sys/socket.h>
#include <sys/types.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#include <unistd.h>

enum ExitCode
{
    OK = 0,
    USAGE_ERR,
    SOCKET_ERR,
    BIND_ERR,
    LISTEN_ERR,
    CONNECT_ERR,
    FORK_ERR
};

class NoCopy
{
public:
    NoCopy()
    {
    }

    ~NoCopy()
    {
    }

    // 把拷贝构造和赋值语句删掉
    NoCopy(const NoCopy &) = delete;
    const NoCopy &operator=(const NoCopy) = delete;
};

#define CONV(addr) ( (struct sockaddr*) &addr)